//
//  TLMobStat.m
//  KidReading
//
//  Created by telen on 16/7/26.
//  Copyright © 2016年 刘赞黄Telen. All rights reserved.
//

#import "TLMobStat.h"
#import "NSObject+Telen.h"
//#import "BaiduMobStat.h"

@implementation TLMobStat

+ (void)logEvent:(NSString *)eventId eventLabel:(NSString *)eventLabel
{
    //[[BaiduMobStat defaultStat] logEvent:eventId eventLabel:eventLabel];
}

+ (void)eventStart:(NSString *)eventId eventLabel:(NSString *)eventLabel
{
    //[[BaiduMobStat defaultStat] eventStart:eventId eventLabel:eventLabel];
}
+ (void)eventEnd:(NSString *)eventId eventLabel:(NSString *)eventLabel
{
    //[[BaiduMobStat defaultStat] eventEnd:eventId eventLabel:eventLabel];
}

+ (void)logEvent:(NSString *)eventId eventLabel:(NSString *)eventLabel attributes:(NSDictionary *)attributes {
//    if (attributes.allKeys.count) {
//        [[BaiduMobStat defaultStat] logEvent:eventId eventLabel:eventLabel attributes:attributes];
//    }
}

@end

#pragma mark-
@implementation UIViewController(TLMobStat)

+ (void)load
{
//    [self swizzleSelector:@selector(viewDidAppear:) withSelector:@selector(viewDidAppear_TLMobStat:)];
//    [self swizzleSelector:@selector(viewDidDisappear:) withSelector:@selector(viewDidDisappear_TLMobStat:)];
}

- (void)viewDidAppear_TLMobStat:(BOOL)animated
{
    [self viewDidAppear_TLMobStat:animated];
    //
    if (self.title && ![self isKindOfClass:[UINavigationController class]]) {
        //[[BaiduMobStat defaultStat] pageviewStartWithName:self.title];
    }
}

- (void)viewDidDisappear_TLMobStat:(BOOL)animated
{
    [self viewDidDisappear_TLMobStat:animated];
    //
    if (self.title && ![self isKindOfClass:[UINavigationController class]]) {
       // [[BaiduMobStat defaultStat] pageviewEndWithName:self.title];
    }
}


@end
